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

Query time 0.00033