UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkjWyXNsCWe0+1W4saUuc2GDq+rYGjJ5VaMVZBPV/RQ='
WHERE
key_id = '5b88196b85485ea0285bd2f1f1739f566e3a97af7e9e385df0dd75aab8e00c4e'
AND (
token = 'NkjWyXNsCWe0+1W4saUuc2GDq+rYGjJ5VaMVZBPV/RQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)