UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IX0jzRCoWfQxHIL85NeSkv006426V9vIJU5DPv6/od8=' 
WHERE 
  key_id = 'cb6d23b0150c4eae7f102b706b38cecef784591a09046aa6d6215d5720ac88c8' 
  AND (
    token = 'IX0jzRCoWfQxHIL85NeSkv006426V9vIJU5DPv6/od8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028