UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GYi/ws6m6zU1Zg6AKNkX8k6rEEklyi4g8z/Q/Eb5QTk=' 
WHERE 
  key_id = '2269a8d8d1c077fd1da6b2969b946e0c48420cec87a71606fbea5dec3a285ec9' 
  AND (
    token = 'GYi/ws6m6zU1Zg6AKNkX8k6rEEklyi4g8z/Q/Eb5QTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033