UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YG3tMPKgfypj0AgRuApqZIEm3m2MOEe3YfWW5QHNMqM=' 
WHERE 
  key_id = '8eeb65bdb8903686e09605124fe0c9ed6d463323c33a3292590c897a5c0467b4' 
  AND (
    token = 'YG3tMPKgfypj0AgRuApqZIEm3m2MOEe3YfWW5QHNMqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043