UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0srvKYH4jYtwoU07/NjeuPm7K9OyJYN7iwkxu3VAAto='
WHERE
key_id = '4d1a046a1bbff6bc7b96c9af24770f5f4cf53649a06725506350d5d72d3f08ee'
AND (
token = '0srvKYH4jYtwoU07/NjeuPm7K9OyJYN7iwkxu3VAAto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)