UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0PfuSclY0DwG6AUxtLjP3u0HY5R6A1qg7VCa86GbrKg=' 
WHERE 
  key_id = '7655f9cdcb4534d3bdf88caab8163f8f41daf10e048c74337d2a226c462edc40' 
  AND (
    token = '0PfuSclY0DwG6AUxtLjP3u0HY5R6A1qg7VCa86GbrKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023