UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AxJE329g0Bt8SDhj0SbzUPgV1Agrb0YHqtBDShEUBD0='
WHERE
key_id = '056a073ebad786fca708c3de895aeedb303421af035ee5670a0be31c9df536b4'
AND (
token = 'AxJE329g0Bt8SDhj0SbzUPgV1Agrb0YHqtBDShEUBD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)