UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uM1MhHSWsYPKUq1qRZTcXtGxBZKlAaTeEvQoQmm1jGA='
WHERE
key_id = '4a1e1feb3c070687458362dff5784bfa2e9d895579bc65a64bdde8d2640ac816'
AND (
token = 'uM1MhHSWsYPKUq1qRZTcXtGxBZKlAaTeEvQoQmm1jGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)