UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTu6zkDZb5HFu6jhZCjaSgu6yj9NZ+R+5/8NNiAy16g='
WHERE
key_id = '52736a9069281dba116a0de0abdbda71420773af12a0b06109726ed5eca6920d'
AND (
token = 'sTu6zkDZb5HFu6jhZCjaSgu6yj9NZ+R+5/8NNiAy16g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)