UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fToaMc0Wg8DR0RN6HFmZWvWFs0yWYm6sLpuB6PfLJIc=' 
WHERE 
  key_id = '67a060c01bf983a69bbfd76d52713f233d4332583ad7efe5fc9ed188fe942811' 
  AND (
    token = 'fToaMc0Wg8DR0RN6HFmZWvWFs0yWYm6sLpuB6PfLJIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021