UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oc+YQBr9CnWw3+o2xXnUx6y29sBhuT31AiICMI64eOg='
WHERE
key_id = '135bc434045ee000b471468e656e18ffa879ea21e176c75d775e37d4127b09a5'
AND (
token = 'Oc+YQBr9CnWw3+o2xXnUx6y29sBhuT31AiICMI64eOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)