UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yva5E+meiIUIDhPwysCTfBouQjT71cWanNVlXhb/S0Y='
WHERE
key_id = 'd0c574ead3f1774343ef711a0b546cc4abf31a54ad6732dd5ef45461c702fa20'
AND (
token = 'Yva5E+meiIUIDhPwysCTfBouQjT71cWanNVlXhb/S0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)