UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IERYeDEAhnSG9m/LFO3fN3/4VUC/BWhsAqwsI4hjh9g='
WHERE
key_id = '264c124ad127069fca635504dd953042cde49e459c88594b11672fb30192f1e8'
AND (
token = 'IERYeDEAhnSG9m/LFO3fN3/4VUC/BWhsAqwsI4hjh9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)