UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbyuEU6rAhuY8fIn3l43aEIPvPAo6j1Qm1XuMkGlKNk=' 
WHERE 
  key_id = '092b4a22de69f5b5c67bfa9ded0500fc30afe788464db3279afc52eded7faec2' 
  AND (
    token = 'zbyuEU6rAhuY8fIn3l43aEIPvPAo6j1Qm1XuMkGlKNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039