UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'saJz3pPZpMxJXkP2Lfck2XFODnlD7tNdmTSYsfbVVR0='
WHERE
key_id = '9280d7bc1564ccaf8da8351c7db8c0686b0418c15346ea989bee76ffb7e99fca'
AND (
token = 'saJz3pPZpMxJXkP2Lfck2XFODnlD7tNdmTSYsfbVVR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)