UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UGISSStFTHRk/kyGZB5AISIQyt6mT8XvroVUoMCsEa0=' 
WHERE 
  key_id = '6ef79f100c149a6e9336cba17350f9fdf8c199fa91f938a48a066df5af9fc94f' 
  AND (
    token = 'UGISSStFTHRk/kyGZB5AISIQyt6mT8XvroVUoMCsEa0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052