UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VkjOS0T5mM1cgzxNEeqFDtcgEXFiuELyt1JmIQx3Iuo=' 
WHERE 
  key_id = 'e210699b435ed67b00df6b729d6acd4773b8e0887b03bfe49fdbb72d49a5b5ca' 
  AND (
    token = 'VkjOS0T5mM1cgzxNEeqFDtcgEXFiuELyt1JmIQx3Iuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015