UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VkZOtBpXDgu36uPfA/9Hh+djT9VRQxM63YIelL0yyA4='
WHERE
key_id = '2080f026dfa1660fea59a87e7dd867ec2e8dc4a31bc2ce3a57f0ea00547c4ff5'
AND (
token = 'VkZOtBpXDgu36uPfA/9Hh+djT9VRQxM63YIelL0yyA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)