UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5pJcR6RUnL1AZEDmRN2gKMP0DBLKhkFrCdnGXp0KWnE='
WHERE
key_id = '16bab90b9914f3c2303701ddea47a1414727d74394a09bfcbc246cec26592863'
AND (
token = '5pJcR6RUnL1AZEDmRN2gKMP0DBLKhkFrCdnGXp0KWnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)