UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6j0ZxdKZ1QHUY/dfLMXcrREbPpTqF0seOpFdm11a/hA='
WHERE
key_id = '45a702305da952e5e92c9d28925cd82b9ff45381699d09d4e81db9db9e82952c'
AND (
token = '6j0ZxdKZ1QHUY/dfLMXcrREbPpTqF0seOpFdm11a/hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)