UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5//pzOtHHZO4PUtvHbTv1KvwiR8FB623u0agAQ+XkcE='
WHERE
key_id = 'd0cd61c2c2a882f8228ee5810b350e31df1bb1d12b207c18ef7c446bd7f5e997'
AND (
token = '5//pzOtHHZO4PUtvHbTv1KvwiR8FB623u0agAQ+XkcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)