UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZVmQR/QmeJec4VKrjIBCJp2cqYibQ8khha9ugq3MQdw='
WHERE
key_id = '376edde81a546f83b90f1840fe6cc03b35c3274d0c67c4451a2a745259883b71'
AND (
token = 'ZVmQR/QmeJec4VKrjIBCJp2cqYibQ8khha9ugq3MQdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)