UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AI2oMXv81cw94SC/sJJfTwJ10OZ6/uNV6PrC12pclt0='
WHERE
key_id = '99f36cce2dd1c25b6662f05c4d98a19ab55de8c177684025d624fdf125819e19'
AND (
token = 'AI2oMXv81cw94SC/sJJfTwJ10OZ6/uNV6PrC12pclt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)