UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7UXNP/1sxwtP06nkxoMDm2u240tfNef6TMxmQpZwgQ4=' 
WHERE 
  key_id = '53f604d3f336f90e4947abdee21810cb464206a22e295154fe0e12141d3fb02d' 
  AND (
    token = '7UXNP/1sxwtP06nkxoMDm2u240tfNef6TMxmQpZwgQ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025