UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HCoOQTgxoQV9Ut02PhpNK5Ab7aWxsrIs4s4+chqHFYE='
WHERE
key_id = '19a7334888153223d05179d3cd970c8c3ed7232488e1fa6897ac85e17b14ad45'
AND (
token = 'HCoOQTgxoQV9Ut02PhpNK5Ab7aWxsrIs4s4+chqHFYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)