UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ISysQk2MwAXJppgnFApiX0JIGX44r66minOUjPBM/pI='
WHERE
key_id = 'bdfb8e01f59e1fb18e1c4634c98d4e38c92d23d76926c92d946fda503b5be667'
AND (
token = 'ISysQk2MwAXJppgnFApiX0JIGX44r66minOUjPBM/pI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)