UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/re0Q6avXYxiFaaxLm5SPuMI6wVPEt1qAzChJ1HdflA='
WHERE
key_id = '78509b94f3d49746178ca971d4681cd841e1349fdf7a69cffbf5e23784b34335'
AND (
token = '/re0Q6avXYxiFaaxLm5SPuMI6wVPEt1qAzChJ1HdflA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)