UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tJPlBrGkgYiAC5tGz9S+yuvknZLBvzBySynuKcPpMls=' 
WHERE 
  key_id = '16c3bcc22c5dce3d9e7fd18f8413fc177c992898a1ee88bbb57ba2df1c6d6529' 
  AND (
    token = 'tJPlBrGkgYiAC5tGz9S+yuvknZLBvzBySynuKcPpMls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030