UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XV1dx0fG1vgEj6OWvH/4Ls7xAYwFo+eYDR/C0wZYN9U='
WHERE
key_id = '8e90a77cb389a14edd3429d0215994c16736b192280437bbb2f08d12366b06c8'
AND (
token = 'XV1dx0fG1vgEj6OWvH/4Ls7xAYwFo+eYDR/C0wZYN9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)