UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7jN6PSS2fd2vSyDkXUgriGCLFISuxCdKgNaGtfchTBo=' 
WHERE 
  key_id = '6e2806215744d113c1ef37149634ad16cc235856895db51bc53bd30a1e990d57' 
  AND (
    token = '7jN6PSS2fd2vSyDkXUgriGCLFISuxCdKgNaGtfchTBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037