UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JoiJUDkDAkVASas0Gt7o35k+ul65isfeT0E1ZF4aZOw='
WHERE
key_id = '421c4aa0d6bdec9b822c647bf506d974f6b2584ea9761c68e97b6294801069f4'
AND (
token = 'JoiJUDkDAkVASas0Gt7o35k+ul65isfeT0E1ZF4aZOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)