UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+JPh4Qn4lom1EMwQh48ELDirB7jEjLTJPI+wyFksU7Y='
WHERE
key_id = '0140a9138b2dc8d93d4b69517689c9228d9240847a83ecc99b21f32faaa39321'
AND (
token = '+JPh4Qn4lom1EMwQh48ELDirB7jEjLTJPI+wyFksU7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)