UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sO9NSsJNJpVoNIm4zfGwO0KBt/DP2qa+iPlcdr5al3Q=' 
WHERE 
  key_id = 'bf8c608c79bf5cad2bd6f914b981e5c2fe08a97db184d8903bd6e65b3fc1259d' 
  AND (
    token = 'sO9NSsJNJpVoNIm4zfGwO0KBt/DP2qa+iPlcdr5al3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026