UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Jiz2rn4O5QuO/3+tbfGcPhGytZu4Wv/gNSun38vyiU='
WHERE
key_id = 'a5ef9b624f31bd93f232e186e98f8955bb54ba74bbc1e6391373fa8864eb2ec6'
AND (
token = '3Jiz2rn4O5QuO/3+tbfGcPhGytZu4Wv/gNSun38vyiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)