UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7KmSP7vGGu5YTo9yL0F6cgAR7Z9bwS+SHutpv9m7800=' 
WHERE 
  key_id = '1b33806c19f690ee11f83265872b7c0a5f4a6af610c20dd201ec46eced88d992' 
  AND (
    token = '7KmSP7vGGu5YTo9yL0F6cgAR7Z9bwS+SHutpv9m7800=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015